home *** CD-ROM | disk | FTP | other *** search
- Path: lrz-muenchen.de!news
- From: watzka@stat.uni-muenchen.de (Kurt Watzka)
- Newsgroups: comp.lang.c
- Subject: Re: HELP on string functions ????
- Date: 6 Mar 1996 09:42:41 GMT
- Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
- Distribution: world
- Message-ID: <4hjmmh$gjm@sparcserver.lrz-muenchen.de>
- References: <313DEA73.7505@msmail.st.stems.com>
- NNTP-Posting-Host: sun2.lrz-muenchen.de
-
- kim hai <Kim_Hai.Ng@msmail.st.stems.com> writes:
-
- >Please help me.
-
- >Can anybody tell me if there is similar function in place of "strset()" ?
-
- This depends on what "strset()" is supposed to do. There is no
- function called strset() in the standard C library. There is
- a function called "strset()" in the library that comes with
- a popular compiler for DOS. Since this function is not very
- useful, there might be a reason not to include it in a library.
-
- >Or is there another way of doing this :
- >I need to reinitialize a char pointer during run-time. The statement
- >char *p; p = ""; is causing me problems.
-
- What kind of problems?
-
- >I can't use "strset(p,'\0')"
- >because the compiler on the unix machine doesn't recognise the function.
-
- As far a C strings are concerned, what exactly would you loose by
- writing "*p = 0;". You get an empty string in both cases. If "p" points
- to a string constant, _both_ methods should be avoided. If "p" points
- to a string that can be modified, "*p = '\0';" clears the string as
- far as C string handling is concerned.
-
- Kurt
- --
- | Kurt Watzka Phone : +49-89-2180-6254
- | watzka@stat.uni-muenchen.de
- | ua302aa@sunmail.lrz-muenchen.de
-